package com.example.eurekaclient.controller;

import com.example.eurekaclient.entity.User;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.jws.soap.SOAPBinding;

/**
 * @author zcx
 * @Title 用户控制器类
 * @date 2019年03月31日 12:14
 **/
@RestController
public class UserController {

    @RequestMapping(value = "/getUser")
    public String getUser() {
        return "I am user list.";
    }

    @RequestMapping(value = "/username")
    public String getUserName(String id) {
        return "id:"+id+"="+"name:"+"zcx";
    }

    @RequestMapping(value = "/userInfo")
    public User getUserInfo(String id) {
        User user = new User(id,"zcx",25);
        return user;
    }

    @RequestMapping(value = "/Info")
    public User getInfo(String name) {
        User user = new User("4",name,25);
        return user;
    }

    @RequestMapping(value = "/postNsername")
    public User postUserName(@RequestParam String id) {
        User user = new User(id,"zcx",25);
        return user;
    }

}
